<!--
 * @Description:
 * @version:
 * @Author: sunqian_sr
 * @Date: 2023-03-16 14:11:27
 * @LastEditors: Andy
 * @LastEditTime: 2023-03-30 10:41:03
-->
<template>
  <div class="notice-list-panel">
    <el-scrollbar class="notice-list" v-if="tableData?.length">
      <div class="notice-item" v-for="(item, index) in tableData" :key="index" @click="handleClickItem(item)">
        <label :title="item.noticeTitle">{{ item.noticeTitle }}</label>
        <span class="notice-tims">
          {{ item.noticeTime.split(' ')[0] }}
        </span>
      </div>
    </el-scrollbar>
    <div class="no-data" v-else>
      <img src="../../../common/assets/images/no-data.png" class="no-data-img" />
    </div>
    <announcement-info ref="announcementInfoCom"></announcement-info>
  </div>
</template>
<script>
  import { TableListMixin } from '@package/utils'
  import { listUrl } from '../../system/api/announcement'
  import AnnouncementInfo from '../../system/components/announcementInfo.vue'

  export default {
    name: 'NoticeInfo',
    components: { AnnouncementInfo },
    mixins: [TableListMixin],
    data() {
      return {
        listUrl
      }
    },
    methods: {
      handleClickItem(noticeInfo) {
        this.$refs.announcementInfoCom.handleOpen(noticeInfo)
      }
    }
  }
</script>
<style scoped>
  ::v-deep .el-scrollbar__bar.is-horizontal {
    height: 0 !important;
  }
  ::v-deep .el-scrollbar__wrap {
    overflow-x: hidden;
  }
</style>
